package com.pn.warehouse.controller;

import com.pn.warehouse.entity.Result;
import com.pn.warehouse.entity.Statistics;
import com.pn.warehouse.service.StatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/statistics")
@RestController
public class StatisticsController {

    @Autowired
    private StatisticsService statisticsService;

    @RequestMapping("/store-invent")
    public Result storeInvent(){
        //1、执行业务并返回
        List<Statistics> storeCountList = statisticsService.findStoreCount();
        return Result.ok(storeCountList);
    }

}
